﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<VERKProjectHopur16.Models.Link>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AllLink
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Links</h2>

    <div>
        <input type="button" onclick="document.location.href = '<%: Url.Action("CreateLink") %>'" value="Add Link" />
    </div>

    <div class="admincontentlist">
        <table>
            <thead>
                <tr>
                    <th><%= Html.ActionLink("Title", "OrderLink", new { id = 1 })%></th>
                    <th><%= Html.ActionLink("Url", "OrderLink", new { id = 2 })%></th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var item in Model) 
                { %>
                <tr>
                    <td><%: item.LinkTitle %></td>
                    <td><%: item.Url %></td>           
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("EditLink", new { id = item.LinkID }) %>'" value="Edit" /></td>                 
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("RemoveLink", new { id = item.LinkID }) %>'" value="Delete" /></td>
                </tr>
                <% } %>
            </tbody>
        </table>
    </div>
</asp:Content>
